package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 销售车
 */
@Data
@NoArgsConstructor
@TableName("t_salecar")
public class SaleCarBean {
    @TableId(value = "pk_saleCarId",type = IdType.AUTO)
    private Integer id;

    @TableField("fk_productId")
    private Integer productId;
    @TableField(exist = false)
    private ProductBean product;
    /**
     * 出库数量
     */
    @TableField("sc_num")
    private Integer num;

    @TableField("fk_userId")
    private Integer userId;

    public SaleCarBean(Integer productId, Integer num, Integer userId) {
        this.productId = productId;
        this.num = num;
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "SaleCar{" +
                "id=" + id +
                ", productId=" + productId +
                ", product=" + product +
                ", num=" + num +
                '}'+"\n";
    }
}
